// 报账验证

const joi = require('joi')

const detail = joi.string().max(255).required() //说明
const type_id = joi.number().integer().required() //报账分类id
const price = joi.number().required() //金额
const use_time = joi.date().required() //使用时间
const images = joi.string().allow("")
const id = joi.number().integer().min(1).required()
const page = joi.number().integer().required()
const limit = joi.number().integer().required()
const type = joi.number().integer().required()

//查询报账
exports.get_list = {
    query:{
        page,
        limit,
        type
    }
}

//新增报账
exports.create_list = {
    body:{
        detail,
        type_id,
        price,
        use_time,
        images
    }
}

//修改报账
exports.update_list = {
    body:{
        id,
        detail,
        type_id,
        price,
        use_time,
        images
    }
}

exports.delete_list = {
    body:{
        id
    }
}

exports.detail = {
    query: {
        id
    }
}
